package com.zhangfb95.crosschain.infra.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author zhangfubing
 * @since 2023/12/28
 */
@AllArgsConstructor
@Getter
public enum SslTypeEnum {

    NONE("none"),
    RSA("rsa"),
    ECDSA("ecdsa"),
    GM("gm"),
    ;

    private final String code;

    public boolean is(String code) {
        return this.code.equals(code);
    }

    public static boolean in(String code, SslTypeEnum... sslTypeEnums) {
        for (SslTypeEnum sslTypeEnum : sslTypeEnums) {
            if (sslTypeEnum.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }
}
